﻿<!DOCTYPE HTML>
<html>
<head>
    <title>用JS实现汉字转拼音</title>
    <meta charset="utf-8" />

    <script src="/Scripts/jquery-3.3.1.min.js"></script>
    <script src="/script/ycat.js.common.pinyin.object.js"></script>
    <script src="/script/ycat.js.common.pinyin.convert.js?v=0.0.0.8"></script>
</head>
<body>
    请输入：<input type="text" id="J_input" /><br /><br />
    全拼：<span id="J_output">...</span><br /><br />
    首字母小写：<span id="J_output1">...</span><br /><br />
    首字母大写：<span id="J_output2">...</span><br /><br />

    <script> 
        $('#J_input').keyup(function () {
            $(this).fullPinyin($('#J_output'));
            $(this).initialLower($('#J_output1'));
            $(this).initialUpper($('#J_output2')); 
        });
    </script>
</body>
</html>